for ii in $(find *.root -type l)
do
    unlink $ii
done

ls

for tpctof in $(echo TPC1TOF0 TPC1TOF1 TPC2TOF0)
do
    for id in $(echo 60 70 80)
    do
        for jpt in $(echo 5-10 10-15 15-20 5-100 20-100 0-100)
        do
            echo $tpctof $id $jpt

            for ii in $(find ../histRecTH*$tpctof*JPT$jpt/*id$id.root)
            do
                echo $ii
                ln -s $ii
            done

            ff=$(for kk in $(find ../../finish/cmpEta_$tpctof\_GrID$id/hist*/ETA1*.root);do dd=$(readlink -f $kk); echo $kk $dd; done | grep "_$jpt\." | awk '{print $1}')
            mm=$(dirname $ff)/Comb*.root
            tt=MC10de_$tpctof\_GrID$id\_JPT$jpt\_$(basename $mm)
            echo $mm $tt
            ln -s $mm $tt

            echo
        done
    done
done



